############################################################
# Makefile
# 2006.12.01 Ting-Shuo Yo
#
# This is the makefile for my experiment on testing evaluation
# methods in Evolutionary Computating.
# 
############################################################
DEV_ROOT = .
EXPDIR = exp/util
MAJDIR = exp/majority
PARDIR = exp/parity
REGDIR = exp/regression
#------------------------------------------------------------
# General definition
#------------------------------------------------------------
JFLAGS = -g
JC = javac
CP = -cp $(DEV_ROOT):$(EXPDIR):ecj15.jar
#CP = -cp "$(DEV_ROOT);ecj15.jar"
.SUFFIXES: .java .class
.java.class:
	$(JC) $(JFLAGS) $(CP) $*.java

#------------------------------------------------------------
# Source definition
#------------------------------------------------------------
# Experiment global classes
EXP = \
		$(EXPDIR)/RankSelection.java \
		$(EXPDIR)/MyExpOutput.java \
		$(EXPDIR)/MyExpFinisher.java \
		$(EXPDIR)/MyExpParam.java \
		$(EXPDIR)/MyExpProblemForm.java \
		$(EXPDIR)/MyExpBreeder.java \
		$(EXPDIR)/MyExpEvaluator.java \
		$(EXPDIR)/MyExpEvaluator2.java \
		$(EXPDIR)/MyExpEvaluator3.java

# For majority function problem
MAJ = \
		$(MAJDIR)/Majority.java 

# For parity problem
PAR = \
		$(PARDIR)/Parity2.java \
		$(PARDIR)/MyParity2.java \
		$(PARDIR)/MyParity.java

# For symbolic regression problem
REG = \
		$(REGDIR)/Regression2.java \
		$(REGDIR)/MyRegression.java

ALL = \
		$(EXP) \
		$(MAJ) \
		$(PAR) \
		$(REG) 

# Default : all
default: all

all: exp maj par reg


# Experiment global classes
exp: $(EXP:.java=.class)

# For majority function problem
maj: exp $(MAJ:.java=.class)

# For parity problem
par: exp $(PAR:.java=.class)

# For symbolic regression problem
reg: exp $(REG:.java=.class)

# Clean up
clean:
		rm -f $(EXPDIR)/*.class
		rm -f $(MAJDIR)/*.class
		rm -f $(PARDIR)/*.class
		rm -f $(REGDIR)/*.class

# Print a help message
help: 
	@ echo ECJ Makefile options
	@ echo 
	@ echo "make          Builds exp class tree for my experiments"
	@ echo "make all	(Same thing)"
	@ echo "make docs     Not defined yet"
	@ echo "make doc	(Same thing)"
	@ echo "make clean    Cleans out all classfiles, checkpoints, and various gunk"
	@ echo "make help     Brings up this message!"
	@ echo
